<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>实验六</title>
</head>

<body>
    <h1>CounterServlet</h1>
    <a href="#" class="a"> CounterServlet</a>
    <script>
        const a = document.querySelector('.a')
        let num = JSON.parse(localStorage.getItem('num')) || 0
        a.addEventListener('click', () => {
            num++
            localStorage.setItem('num', JSON.stringify(num))
            location.href = './a.html'
        })
    </script>
</body>

</html>